package com.itheima.studenthomework.controller;

import java.util.Scanner;

public class HeimaController {
    public void start(){
        Scanner sc = new Scanner(System.in);

        loop:
        while (true) {
            System.out.println("=========欢迎来到黑马管理系统=========");
            System.out.println("1.学生管理系统");
            System.out.println("2.老师管理系统");
            System.out.println("3.返回上一级");
            System.out.println("4.退出");
            String str = sc.next();

            switch (str){
                case "1":
                    StudentController stc = new StudentController();
                    stc.start();
                    break;
                case "2":
                    System.out.println("请输入指令：");
                    String command = sc.next();
                    if("1234".equals(command)){
                        TeacherController tct = new TeacherController();
                        tct.start();
                    }else {
                        System.out.println("指令错误！");
                    }
                    break;
                case "3":
                    break loop;
                case "4":
                    System.out.println("感谢您的使用！");
                    System.exit(0);
                default:
                    System.out.println("您的输入有误，请重新输入！");
            }
        }
    }
}
